package com.cencat.order.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 订单更新VO
 * @author cencat
 * @description 固定商家场景多租户SaaS企业综合管理系统订单更新VO
 * @since 2024-01-01
 */
@Data
@Accessors(chain = true)
@Schema(name = "OrderUpdateVO", description = "订单更新VO")
public class OrderUpdateVO implements Serializable {

    private static final long serialVersionUID = 1L;

    @Schema(description = "收货人姓名")
    @Size(max = 100, message = "收货人姓名长度不能超过100个字符")
    private String receiverName;

    @Schema(description = "收货人手机号")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "收货人手机号格式不正确")
    private String receiverPhone;

    @Schema(description = "收货人邮箱")
    @Email(message = "收货人邮箱格式不正确")
    @Size(max = 100, message = "收货人邮箱长度不能超过100个字符")
    private String receiverEmail;

    @Schema(description = "收货地址省份")
    @Size(max = 50, message = "收货地址省份长度不能超过50个字符")
    private String receiverProvince;

    @Schema(description = "收货地址城市")
    @Size(max = 50, message = "收货地址城市长度不能超过50个字符")
    private String receiverCity;

    @Schema(description = "收货地址区县")
    @Size(max = 50, message = "收货地址区县长度不能超过50个字符")
    private String receiverDistrict;

    @Schema(description = "收货详细地址")
    @Size(max = 200, message = "收货详细地址长度不能超过200个字符")
    private String receiverAddress;

    @Schema(description = "收货地址邮编")
    @Pattern(regexp = "^\\d{6}$", message = "收货地址邮编格式不正确")
    private String receiverPostcode;

    @Schema(description = "配送方式：EXPRESS-快递配送，SELF_PICKUP-自提")
    @Pattern(regexp = "^(EXPRESS|SELF_PICKUP)$", message = "配送方式不正确")
    private String shippingMethod;

    @Schema(description = "配送费用")
    @DecimalMin(value = "0.00", message = "配送费用不能为负数")
    @Digits(integer = 10, fraction = 2, message = "配送费用格式不正确")
    private BigDecimal shippingFee;

    @Schema(description = "优惠金额")
    @DecimalMin(value = "0.00", message = "优惠金额不能为负数")
    @Digits(integer = 10, fraction = 2, message = "优惠金额格式不正确")
    private BigDecimal discountAmount;

    @Schema(description = "订单备注")
    @Size(max = 500, message = "订单备注长度不能超过500个字符")
    private String remark;

    @Schema(description = "是否需要发票：0-不需要，1-需要")
    @Min(value = 0, message = "是否需要发票值不正确")
    @Max(value = 1, message = "是否需要发票值不正确")
    private Integer needInvoice;

    @Schema(description = "发票类型：PERSONAL-个人，COMPANY-企业")
    @Pattern(regexp = "^(PERSONAL|COMPANY)$", message = "发票类型不正确")
    private String invoiceType;

    @Schema(description = "发票抬头")
    @Size(max = 200, message = "发票抬头长度不能超过200个字符")
    private String invoiceTitle;

    @Schema(description = "发票税号")
    @Size(max = 50, message = "发票税号长度不能超过50个字符")
    private String invoiceTaxNo;

    @Schema(description = "发票内容")
    @Size(max = 500, message = "发票内容长度不能超过500个字符")
    private String invoiceContent;
}